package day4;

import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommand;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommandDescription;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisMapper;

public class RedisSink implements RedisMapper<String[]> {
    @Override
    public RedisCommandDescription getCommandDescription() {
        return new RedisCommandDescription(RedisCommand.SET);
    }

    @Override
    public String getKeyFromData(String[] data) {
        return "totalproduce";
    }

    @Override
    public String getValueFromData(String[] data) {
        return "设备 "+data[0] + "最近五分钟生产总数" + data[1];
    }
}
